package com.dev.sacot41.scviewpager;

import ohos.aafwk.ability.Ability;
import ohos.agp.utils.Point;
import ohos.app.Context;

/**
 * Created by Samuel on 2015-07-06.
 */
public class SCViewAnimationUtil {

    /**
     * 获取屏幕尺寸
     *
     * @param context 上下文
     * @return 屏幕尺寸
     */
    public static Point getDisplaySize(Ability context) {
        return new Point(getWindowWdith(context), getWindowHeight(context));
    }

    /**
     * 获取屏幕宽
     *
     * @param context 上下文
     * @return 屏幕宽
     */
    public static int getWindowWdith(Context context) {
        return context.getResourceManager().getDeviceCapability().width * context.getResourceManager().getDeviceCapability().screenDensity / 160;
    }

    /**
     * 获取屏幕高
     *
     * @param context 上下文
     * @return 屏幕高
     */
    public static int getWindowHeight(Context context) {
        return context.getResourceManager().getDeviceCapability().height * context.getResourceManager().getDeviceCapability().screenDensity / 160;
    }

}
